import java.util.Arrays;
import java.util.Comparator;

public class Arr {
    public static void main(String[] args) {
        //函数式编程
        //lambda表达式
        Integer arr[]={6,1,2,5,3,9,5,0};
        //普通排序（规则
        Arrays.sort(arr,
                new Comparator<Integer>() {
                    @Override
                    public int compare(Integer o1, Integer o2) {
                        return o2-o1;
                    }
                });
        System.out.println(Arrays.toString(arr));
        //lambda  简洁！！
        Arrays.sort(arr,(o1,o2)->o2-o1);
        System.out.println(Arrays.toString(arr));
    }
}
